#include <QtCore>
#include <string>
#include <vector>
#include <list>
#include "PacketUtil/GateWay.h"
#include "SemanticUtil/TriplePattern.h"
#include "SemanticUtil/NTuple.h"
#include <sstream>
#include <iostream>

#ifndef _REASONPACKET_H_
#define _REASONPACKET_H_
			//////////////////////////////////////////////////////////////////////////
			//			 					ReasonPacket
			//	  | query_ID | subquery_size | current_subquery_num |
			//    | whole_query || query 1..|....query n	 | 	init node	|coordinate 1  ...| ... coordinate n |
			//    | variable_size | variable 1 ...|... variable n |
			//    | pattern 1|....pattern n  | partial_ans_1....|... partial_ans_n |
			//
			//////////////////////////////////////////////////////////////////////////
class ReasonPacket{
public:
	ReasonPacket();
	~ReasonPacket();
	ReasonPacket(std::string f);
	void setFileName(std::string f);
	void readFromFile();
	void writetoFile();
	std::string toString();
	std::string iToString(int i);
public:
	std::string fileName;
	std::string query_id;
	int subquery_size;
	int current_subquery;
	std::string whole_query;
	std::vector<std::string> sub_query;
	GateWay init_node;
	std::vector<GateWay> destination;
	int variable_size;
	std::vector<std::string>  variables;  //全局目标变量
	std::vector<std::vector<std::string> > subquery_variables;
	std::vector<TriplePattern> subquery_patterns;
	int ans_size;
	std::vector<NTuple> partial_ans;
	QString data_qstr;
	QStringList data_list;


};
#endif // _REASONPACKET_H_
